#include <stdio.h>
#include <tchar.h>
#include <iostream>

#include "trap.h"
#include <time.h>

trap::trap(void)
{
	f = NULL;
}

trap::trap(world* w)
{
	srand((int)time(NULL));
	int i,j;
	do
	{
		i = rand()%(MAP_SIZE_WIDTH-2) + 1;
		j = rand()%(MAP_SIZE_HEIGHT-2) + 1;
	}  while (w->map[i][j]->gettype() != blank || i < 3 || j <3 || j > 8);
	w->map[i][j]->settype(traps);
	f = w->map[i][j];
	//w->map[10][10]->settype(foods);
	//f = w->map[10][10];
}

note* trap::gettr()
{
	return f;
}


trap::~trap(void)
{
}
